package com.sunwayworld.basemodule.common.asynctask.config;

import com.sunwayworld.basemodule.common.asynctask.service.LimsAsynctaskService;
import com.sunwayworld.basemodule.common.asynctask.util.AsyncTaskExecutorHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

//线程池注入
@Service
public class AsyncTaskExecutorListener implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private AsyncTaskExecutorHelper asyncTaskExecutorHelper;
    @Autowired
    private LimsAsynctaskService asynctaskService;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        asyncTaskExecutorHelper.register();
        asyncTaskExecutorHelper.startFixTaskScheduleGetTask();
    }
}
